package com.example.demo.adapter;

import com.example.demo.Test.MusicPlayer;
import com.example.demo.Test.WavPlayer;

public class WavPlayerAdapter implements MusicPlayer {
//    声明私有成员变量
    private WavPlayer wavPlayer;
//    WavPlayerAdapter的无参构造
    public WavPlayerAdapter() {
//    创建一个新的WavPlayerAdapter对象，并将其赋值给wavPlayer成员变量，完成对wavPlayer的初始化
        this.wavPlayer = new WavPlayer();
//        wavPlayer = new WavPlayer();
    }
    @Override
    public void play() {
        wavPlayer.playMusic();
    }
}
